<!DOCTYPE html>
<html lang="en" style="font-size:75px;">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>阿里双十一</title>
    <script>
//阻塞 来动态设置 html font-size
//立即执行函数，没有括号是匿名函数
(function(){
// console.log('立即执行函数')
function calc(){
  const w = document.documentElement.clientWidth;
  console.log(w);
  document.documentElement.style.fontSize 
  = 75*(w/ 750 ) + 'px';
}
calc()
// 
window.onresize = function(){
//   ocnsole.log('resize')
calc();
}
}) ()
    </script>
    <style>
        *{
            margin:0;
            padding: 0;
        }
        /* .box{
           width: 5rem;
           height: 5rem;
           background-color: red;
           display: inline-block;
        }
        .box2{
           width: 200px;
           height: 200px;
           background-color: green;
           display: inline-block;
        } */
    </style>
</head>
<body>
    <div>
    <div style="width:10rem;height:2rem;background-color:red;"></div>
    <div style="font-size:0;">
    <div style="width:5rem;height:2rem;background-color:green; display: inline-block; font-size:20px;color:white;">111</div>
    <div style="width:5rem;height:2rem;background-color:blue;  display: inline-block;">222</div>
</div>
</body>
</html>